package com.sebiotec.driver.net;



import com.sebiotec.driver.model.SearchEntrty;
import com.sebiotec.driver.model.response.JobDetailResponse;
import com.sebiotec.driver.model.response.JobListResponse;
import com.sebiotec.driver.model.response.MessListResponse;
import com.sebiotec.driver.model.response.MessageDetailResponse;
import com.sebiotec.driver.model.response.UseProfileResponse;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.HeaderMap;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;

public interface BookAPi {



     //获取job


    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/SearchDriverJobs")
    Observable<JobListResponse> getJob(@HeaderMap Map<String, Object> headers, @Body RequestBody body);





    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Drivers/SearchJobHistory")
    Observable<SearchEntrty> getHistoryBookings(@HeaderMap Map<String, Object> headers, @Body RequestBody body);



    @GET("/api/Users/{LoginId}")
    Observable<UseProfileResponse> getUser(@HeaderMap Map<String, Object> headers, @Path("LoginId") String LoginId);



    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Users/{LoginId}")
    Observable<ResponseBody> EditTextUser(@HeaderMap Map<String, Object> headers, @Path("LoginId") String LoginId, @Body RequestBody body);

    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Users/Password/{LoginId}")
    Observable<ResponseBody> EditPwd(@HeaderMap Map<String, Object> headers, @Path("LoginId") String LoginId, @Body RequestBody body);


    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/SearchMessage")
    Observable<MessListResponse> MessageList(@HeaderMap Map<String, Object> headers, @Body RequestBody body);



    //已读https://localhost:5330/api/Messages/{Id}
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Messages/{Id}")
    Observable<ResponseBody> isRead(@HeaderMap Map<String, Object> headers, @Path("Id") String Id, @Body RequestBody body);



    //已读https://localhost:5330/api/Messages/{Id}
    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("api/Drivers/JobRead/{BookinId}")
    Observable<ResponseBody> JobisRead(@HeaderMap Map<String, Object> headers, @Path("BookinId") String BookinId, @Body RequestBody body);

    @GET("/api/Messages/{BookingId}")
    Observable<MessageDetailResponse> getMessageDetail(@HeaderMap Map<String, Object> headers, @Path("BookingId") String BookingId);


    //查看

    @GET("/Drivers/{BookingId}")
    Observable<JobDetailResponse> getJobDetail(@HeaderMap Map<String, Object> headers, @Path("BookingId") String BookingId);


    //修改job状态


    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Drivers/{BookingId}")
    Observable<ResponseBody> UpdateJob(@HeaderMap Map<String, Object> headers, @Path("BookingId") String BookingId, @Body RequestBody body);


    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/Logout")
    Observable<ResponseBody>  LoginOut(@HeaderMap Map<String, Object> headers);


    @Headers({"Content-Type: application/json","Accept: application/json"})
    @POST("/api/FCMToken")
    Observable<ResponseBody>FCMToken(@HeaderMap Map<String, Object> headers);




}
